package com.jhy.controller;

import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jhy.core.domain.LoginUser;
import com.jhy.core.domain.R;
import com.jhy.core.enums.DeviceType;
import com.jhy.core.helper.LoginHelper;
import com.jhy.core.utils.Check;
import com.jhy.system.domain.TUser;
import com.jhy.system.domain.bo.SysUserLoginBo;
import com.jhy.system.mapper.TOrderMapper;
import com.jhy.system.mapper.TUserMapper;
import com.jhy.system.service.ISysUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

@RequiredArgsConstructor
@RequestMapping("/sysUser")
@RestController()
public class SysUserController {


    private final ISysUserService userService;


    /**
     * 登录
     * **/
    @PostMapping("/login")
    public R<Map<String,Object>> login(@RequestBody SysUserLoginBo bo) {
        return R.ok("ok",userService.login(bo));
    }

    /**
     * 注册
     * **/
    @PostMapping("/register")
    public R<Boolean> register(@RequestBody SysUserLoginBo bo) {
        return R.ok("ok",userService.register(bo));
    }



}
